#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"

int sub1(lua_State* L)
{  
    int a = lua_tonumber(L, 1);
    int b = lua_tonumber(L, 2);
    lua_pop(L, 2);
    int r = a - b;
    lua_pushnumber(L, r);
    return 1;
}
    

int main()
{
    lua_State* L = luaL_newstate();
    luaL_openlibs(L);

    lua_register(L, "sub1", sub1);
    int r = luaL_dofile(L, "call.lua");

    lua_close(L);
    return 0;
}